09. Bounding Boxes
Header Text
Bounding Boxes
Now that you know how point cloud clustering works, we will return to the main project code. In this next exercise, you will add bounding boxes to the point cloud clusters that you previously found.
Boxing Clusters
Bounding Boxes
As a final touch, you can add bounding boxes around the clusters. The bounding box volume could also be thought of as space the car is not allowed to enter, or it would result in a collision. Your point processor already has a bounding box function all set up. This function is already predefined since it’s doing a very simple technique for generating a box. The function
BoundingBox
looks at the min and max point values of an input cloud and stores those parameters in a box struct container. To render bounding boxes around your clusters you can can add the following code inside the loop that renders clusters in
environment.cpp
.
Box box = pointProcessor->BoundingBox(cluster);
renderBox(viewer,box,clusterId);
The results of doing this are shown in the image above.
Instructions
-
In
src/environment.cpp
add the renderBox function to render boxes around clusters
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: react
- Opened files (when workspace is loaded): n/a
Solution
ND313 C01 L03 Rendering Bounding Boxes